//对外暴露配置路由(常量路由):全部用户都可以访问到的路由
export const constantRoute = [
    {
        //登录
        path: '/login',
        component: () => import('@/views/TheLogin.vue'),
        name: 'login',
        meta: {
            title: '登录', //菜单标题
            hidden: true, //代表路由标题在菜单中是否隐藏  true:隐藏 false:不隐藏
            icon: 'Promotion', //菜单文字左侧的图标,支持element-plus全部图标
        },
    },
    {
        //登录成功以后展示数据的路由
        path: '/',
        component: () => import('@/layout/index.vue'),
        name: 'layout',
        meta: {
            title: '',
            hidden: false,
            icon: '',
        },
        redirect: '/home',
        children: [
            {
                path: '/home',
                component: () => import('@/views/TheHome.vue'),
                meta: {
                    title: '首页',
                    hidden: false,
                    icon: 'HomeFilled',
                },
            },
        ],
    },
    {
        //404
        path: '/404',
        component: () => import('@/views/404/index.vue'),
        name: '404',
        meta: {
            title: '404',
            hidden: true,
            icon: 'DocumentDelete',
        },
    },
]

//异步路由
export const asyncRoute = [
    {
        path: '/menu-store',
        component: () => import('@/layout/index.vue'),
        name: 'menu-store',
        meta: {
            title: '店铺管理',
            icon: 'House'
        },
        redirect: '/menu-store/store',
        children: [
            {
                path: '/menu-store/store',
                component: ()=> import('@/views/store/TheStore.vue'),
                name: 'store',
                meta: {
                    title: '分店管理',
                    icon: 'Location'
                },
            },
            {
                path: '/menu-store/product',
                component: ()=> import('@/views/store/TheProduct.vue'),
                name: 'product',
                meta: {
                    title: '货品管理',
                    icon: 'Box'
                },
            },
            {
                path: '/menu-store/inventory',
                // component: ()=> import('@/views/store/LogProductNumber.vue'),
                component: ()=> import('@/views/store/inventory/index.vue'),
                name: 'log-product-number',
                meta: {
                    title: '货品入出库管理',
                    icon: 'Switch'
                },
            },
        ]
    },
    {
        path: '/menu-personnel',
        component: () => import('@/layout/index.vue'),
        name: 'menu-personnel',
        meta: {
            title: '人员管理',
            icon: 'User'
        },
        redirect: '/menu-personnel/clerk',
        children: [
            {
                path: '/menu-personnel/clerk',
                // component: () => import('@/views/personnel/TheClerk.vue'),
                component: () => import('@/views/personnel/clerk/index.vue'),
                name: 'clerk',
                meta: {
                    title: "店员管理",
                    icon: 'Service'
                },
            },
            {
                path: '/menu-personnel/customer',
                // component:()=>import('@/views/personnel/TheCustomer.vue'),
                component:()=>import('@/views/personnel/customer/index.vue'),
                name: 'customer',
                meta: {
                    title: "客户管理",
                    icon: 'User'
                }
            }
        ]
    },
    {
        path: '/menu-voucher',
        component: () => import('@/layout/index.vue'),
        name: 'menu-voucher',
        meta: {
            title: "卡券管理",
            icon: 'Goods'
        },
        redirect: '/menu-voucher/voucher',
        children: [
            {
                path: '/menu-voucher/voucher-type',
                // component:()=>import('@/views/item/TheVoucher.vue'),
                component: ()=>import('@/views/coupon/coupon_type/index.vue'),
                name: 'voucher',
                meta: {
                    title: "卡券类型管理",
                    icon: 'Postcard'
                },
            },
            {
                path: '/menu-voucher/voucher',
                // component:()=>import('@/views/deal/DealVoucher.vue'),
                component:()=>import('@/views/coupon/coupon/index.vue'),
                name: 'deal-voucher',
                meta: {
                    title: "卡券订单管理",
                    icon: 'Goods'
                },
            },
        ]
    },
    {
        path: '/menu-deal',
        component: () => import('@/layout/index.vue'),
        name: 'menu-deal',
        meta: {
            title: "订单管理",
            icon: 'ShoppingCart'
        },
        redirect: '/deal/product',
        children: [
            {
                path: '/deal/product',
                // component:()=>import('@/views/deal/DealProduct.vue'),
                component:()=>import('@/views/deal/order/index.vue'),
                name: 'deal-product',
                meta: {
                    title: "货品订单管理",
                    icon: 'Wallet'
                },
            },
            {
                path: '/log/deal/product-number',
                // component:()=>import('@/views/deal/LogDealProductNumber.vue'),
                component:()=>import('@/views/deal/deal_number/index.vue'),
                name: 'log-deal-product-number',
                meta: {
                    title: "货品订单数量管理",
                    icon: 'Tickets'
                },
            },
            {
                path: '/log/deal/product-payment',
                // component:()=>import('@/views/deal/LogDealProductPayment.vue'),
                component:()=>import('@/views/deal/deal_payment/index.vue'),
                name: 'log-deal-product-payment',
                meta: {
                    title: "货品订单金额管理",
                    icon: 'Coin'
                },
            },
        ]
    },
    {
        path: '/menu-settings',
        component: () => import('@/layout/index.vue'),
        name: 'menu-settings',
        meta: {
            title: "设置",
            icon: 'Setting'
        },
        redirect: '/settings',
        children: [
            {
                path: '/settings',
                component:()=>import('@/views/TheSettings.vue'),
                name: 'settings',
                meta: {
                    title: "设置",
                    icon: 'Setting'
                },
            },
        ]
    },
]

//任意路由
export const anyRoute = {
    //任意路由
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    name: 'Any',
    meta: {
        title: '任意路由',
        hidden: true,
        icon: 'DataLine',
    },
}